/*
 * @Description: 新建检测方案 - 系统检测规则面板
 * @Author: Rfan
 * @Date: 2022-10-10 11:23:21
 * @LastEditTime: 2022-10-21 18:11:39
 */

import { Tabs } from 'antd';
import { CheckProps } from '../../../../../../dictionaries';
import EnvironmentSecurityCheck from './SecurityCheck';
import type { IBaseDic } from '@/interfaces/global';
import type { IRefList } from '../index';

const { TabPane } = Tabs;

interface IEnvironmentPanesProps {
  paneList: IBaseDic[];
  refList: IRefList;
}

const EnvironmentPanes = (props: IEnvironmentPanesProps) => {
  const { paneList, refList } = props;
  return (
    <>
      {paneList.map((item: any) => (
        <TabPane tab={item.name} key={item.id}>
          {item.id === CheckProps.Security && (
            <EnvironmentSecurityCheck ref={refList.securityRef} />
          )}
        </TabPane>
      ))}
    </>
  );
};

export default EnvironmentPanes;
